<!--{template common/header_simple_start}-->
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all"> 
<link href="{MOD_PATH}/images/market.css?{VERHASH}" rel="stylesheet" media="all"> 
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
<style>
.app-name-wrapper {
    padding-left: 55px;
    position: relative;
	max-width:250px;
	min-height:50px;
}
.app-name-wrapper .appicon {
    position: absolute;
    left: 0;
    top: 2px;
}.app-name-wrapper .appicon img {
    max-width: 45px;
    max-height: 45px;
    margin: 0;
}
.app-name-wrapper .appname{
	margin:0;
	line-height:30px;
	
}
.app-name-wrapper .appname a{
	color:#000;
	font-weight:500;
	font-size:14px;
}
.app-name-wrapper .appdesc{
	white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
	color:#999;
	font-size:13px;
	cursor:default;
}
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{
	white-space:nowrap;
}
.group-td-wrapper{
	max-width:120px;
	white-space:normal;
	overflow: hidden;
    text-overflow: ellipsis;
}
.group-td-wrapper>span {
	white-space:nowrap;
	overflow: hidden;
    text-overflow: ellipsis;
}
.group-td-wrapper>span>img {
	margin:0;
	vertical-align: text-bottom;
}
.tag-td-wrapper{
	max-width:120px;
	white-space:normal;
	overflow: hidden;
    text-overflow: ellipsis;
}
.tag-td-wrapper a{
	color:#333;
	display:inline-block;
	padding:0 2px;
	white-space:nowrap;
	overflow: hidden;
    text-overflow: ellipsis;
}
.app-info a{
	color:#999;
}
.app-info .select-info{
	position:absolute;
	left:0;
	top:10px;
	display:none;
} 
.main-header{
	padding:5px
}
.main-header>div{
	line-height:34px;
	/*margin:0 5px;*/
}
.checkbox-custom{
	margin-bottom:0;	
}
.table td img {
    max-width: 45px; 
    max-height: 45px; 
}
</style>
<!--{template common/header_simple_end}-->
<!--{template common/commer_header}-->
<div class="bs-container clearfix">
	<div class="bs-left-container  clearfix">
		<!--{template left}-->
	</div>
	<div class="left-drager">
	</div>	
	<div class="bs-main-container">
		<div class="all-center-top clearfix">
				<div class="app-info pull-left">
                	<a href="{MOD_URL}">{lang total}<span class="num">$count</span>{lang ge}{lang app}</a>
                    <span class="select-info">{lang selected}<span class="num">$count</span>{lang ge}{lang app}</span>
                </div>
               
				<div class="tag-filter dropdown pull-right">
					
                    <a href="javascript:;" data-toggle="dropdown" role="button" id="tag-drop"  class="dropdown-toggle btn btn-link">{eval echo $tagid?$tags[$tagid][tagname]:lang('label');}<b class="caret"></b></a>
					<ul aria-labelledby="tag-drop" role="menu" class="dropdown-menu" id="tag-drop-menu">
                        <li>
							<a href="javascript:;"  onclick="screen_app('0','$_GET[group]')";>{lang all}</a>
						</li>
						<!--{loop $tags  $value}-->
						<li>
							<a href="javascript:;"  onclick="screen_app('$value[tagid]','$_GET[group]')";>$value[tagname]</a>
						</li>
						<!--{/loop}-->
					</ul>
				</div>
			
                <div class="group-filter dropdown pull-right">
					<a href="{MOD_URL}&group=$group" data-toggle="dropdown" role="button" id="drop-group" class="dropdown-toggle btn btn-link">{eval echo $group?$grouptitle[$group]:lang('group_permissions');}<b class="caret"></b></a>
					<ul aria-labelledby="drop-group" role="menu" class="dropdown-menu" id="drop-group-menu">
						<!--{loop $grouptitle $key $value}-->
						<li role="presentation"> 
							<a href="javascript:;" onclick="screen_app('$_GET[tagid]','$key')"; tabindex="-1" role="menuitem">$value</a>
						</li>
						<!--{/loop}-->
					</ul>
				</div>
			
			<div  class="button_add_content">
				<a href="{MOD_URL}&op=edit&do=add&refer=$refer" id="button_add1" title="{lang add_app}" class="hide">+</a>				
				<a href="{MOD_URL}&op=import&refer=$refer" id="button_add2" class="hide" title="{lang import_type_app}" style="font-size:20px ;"><i  class="glyphicon glyphicon-download-alt"></i></a>				
				<a href="javascript:;" id="button_add" style="z-index: 10;">+</a>				
			</div>	
		</div> 
		
		<div class="main-content clearfix" style="border-top:1px solid #FFF;padding:0;">
			<form id="appform" name="appform" class="form-horizontal" action="{MOD_URL}" method="post">
				<input type="hidden" name="appsubmit" value="true" />
				<input type="hidden" name="formhash" value="{FORMHASH}" />
				<table class="table table-hover">
					<thead> 
						<th >{lang application_name}</th>
						<th >{lang supplier}</th>
						<th >{lang label}</th>
						<th >{lang group_permissions}</th>
						
						<th >{lang operation}</th>
					</thead>
					<!--{loop $list $value}-->
					<tr> 
						<td>
                             <a href="$value[appurl]" target="_blank" class="appicon" style="float: left;padding-right: 5px;"><img src="$value[appico]" style="margin:0" /></a>
                            <p class="appname">
                            <!--{if $value[appadminurl]}-->
                            	<a href="$value[appadminurl]" target="_blank" >$value[appname]</a>
                            <!--{else}-->
                            	<a href="$value[appurl]" target="_blank" >$value[appname]</a>
                            <!--{/if}--> 
                            <small class="text-muted" title="{lang version}">$value[version]</small>    
                            </p>
							<div class="appdesc" title="$value['appdesc']"> {eval echo $value['appdesc']?$value['appdesc']:lang('none');}</div>
                            <!-- </div> -->
						</td>
						<td>$value[vendor]</td>
						<td>
                         <div class="tag-td-wrapper">
							<!--{loop $value[tags] $key $value1}-->
							<a href="{MOD_URL}&tagid=$value1[tagid]">$value1[tagname]</a>
							<!--{/loop}-->
                          </div>
						</td>
						<td>
                        <!--{if $value['department']}-->
                        <div class="group-td-wrapper">
                        	<!--{loop $value['department'] $key $value1}-->

							<span appid="$value[appid]" orgid="$key" class="label label-default " style="display:inline-block"> <img src="dzz/system/images/organization.png" >
                            	{eval $i=0;}
								<!--{loop $value1 $value2}-->
								<!--{if $i>0}-->-<!--{/if}-->$value2[orgname] 
                                {eval $i++;}
								<!--{/loop}-->
							</span>
							<!--{/loop}-->
                        </div>
                        <!--{else}-->
                       		 $value[grouptitle]
                        <!--{/if}-->
                        </td>
						
						<td>
							<!--{if $value[appadminurl]}-->
							<a class="btn btn-small btn-info-outline"  href="$value[appadminurl]">设置</a>
							<!--{/if}-->
							<a class="btn btn-primary-outline btn-small" href="{MOD_URL}&op=edit&do=edit&appid=$value[appid]&refer=$refer" title="{lang edit}">{lang edit}</a>
							
							
							<!--{if $value["system"]!=2}-->
							<!--{if $value["available"]==1}-->
							<a class="btn btn-warning-outline btn-small" href="{MOD_URL}&op=cp&do=disable&appid=$value[appid]&refer=$refer" title="{lang close}">{lang close}</a>
							<!--{else}-->
							<a class="btn btn-success-outline btn-small" href="{MOD_URL}&op=cp&do=enable&appid=$value[appid]&refer=$refer" title="{lang enable}">{lang enable}</a>
							<a class="btn btn-danger-outline btn-small" href="{MOD_URL}&op=cp&do=uninstall&appid=$value[appid]&refer=$refer" title="{lang uninstall}" onclick="if(confirm('{lang list_uninstall_application}'))return true;else return false">{lang uninstall}</a>
							<!--{/if}-->
							<!--{else}-->
							<!--{if $value["available"]!=1}--> 
							<a class="btn btn-small btn-success-outline" href="{MOD_URL}&op=cp&do=enable&appid=$value[appid]&refer=$refer" title="{lang enable}">{lang enable}</a>
							<!--{/if}-->
							<!--{/if}-->
							<a class="btn btn-primary-outline btn-small" href="{MOD_URL}&op=cp&do=export&appid=$value[appid]&refer=$refer" title="{lang export}" target="_blank">{lang export}</a>
						</td>
					</tr>
					<!--{/loop}-->
					<!--{if $multi}-->
					<tr>
						<td colspan="20" align="center" style="border:none">$multi </td>
					</tr>
					<!--{/if}-->
				</table>
			</form>
		</div>
	</div>
</div>
<script type="text/javascript">
	jQuery('.left-drager').leftDrager_layout();
	function screen_app(tagid,group){
	var url = MOD_URL;
		if(tagid){
			url += '&tagid='+tagid;
		}
		if(group){
			url += '&group='+group;
		}
		var inputval = jQuery('#screen_keyword').val();
		if(inputval){
			url += '&keyword='+inputval;
		}
		console.log(url);
//		return false;
		window.location.href =url;	 
	}
	<!--{loop $list $value}-->
		//start_check_upgrade( '{$value[appid]}' );
	<!--{/loop}-->
	function start_check_upgrade(appid){
		jQuery.post({
			type:'post',
			async: true, 
			url:'{MOD_URL}&op=upgrade_app_ajax&operation=check_upgrade&appid='+appid+'&t='+new Date().getTime(),
			data:{},
			success:function(json){ 
				if(json.status==0){
					jQuery('#upgrade_info_'+mid).show().text(json.msg);  
				}else{ 
					jQuery("#"+appid+"_update").removeClass("hidden"); 
				}
			} 
		});
	}
	
	jQuery('#button_add').click(function(){
		if(jQuery("#button_add1").hasClass('hide')){
			jQuery("#button_add").html("×");
			jQuery("#button_add1").removeClass("hide");
			jQuery("#button_add2").removeClass("hide");
			jQuery("#button_add1").stop().animate({top:"-124px"},500);
			jQuery("#button_add2").stop().animate({top:"-62px"},500);
		}else{
			jQuery("#button_add").html("＋");
			jQuery("#button_add1").stop().animate({top:"0px"},500);
			jQuery("#button_add2").stop().animate({top:"0px"},500);
			setTimeout(function(){
				jQuery("#button_add1").addClass("hide");
				jQuery("#button_add2").addClass("hide");
			},500)
			
		}
	});
</script>
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
<!--{template common/footer_simple}-->